var path = require('path');
var webpack = require('webpack');
var ProgressBarPlugin = require('progress-bar-webpack-plugin');

module.exports = {
    entry: {
        bundle: ["./App.js"],
        vendor: [
            'react',
            'react-dom',
            'react-router',
            'react-router-dom'
        ]
    },
    output: {
        path: path.resolve(__dirname, 'public'),
        filename: "[name].js",
        chunkFilename: "[name].[chunkhash:8].js"
    },
    module: {
        loaders: [
            {
                test: /.\js$/,
                loader: "babel-loader"
            }
        ]
    },
    plugins: [
        new webpack.optimize.CommonsChunkPlugin({
            names: ['vendor', 'manifest'],
            filename: '[name].js'
        }),
        new webpack.DefinePlugin({
                'process.env.NODE_ENV': '"production"'
            }
        ),
        new ProgressBarPlugin({summary: true}),
    ],
    devServer: {
        port: 3003,
        contentBase: './public',
        historyApiFallback: true,
        inline: true
    }
}